﻿using System;
using System.Collections.Generic;
using System.IO;

namespace Xenta.Api
{
    /// <summary>
    /// Exposes the API handler interface.
    /// </summary>
    public interface IHandler : IDependency
    {
        /// <summary>
        /// Handles the input stream, using the ingoing properties, 
        /// and returns the result to the output stream, filling 
        /// the outgoing properties.
        /// </summary>
        /// <param name="mimeType">The MIME type string reference.</param>
        /// <param name="inProperties">The ingoing properties.</param>
        /// <param name="inStream">The input stream.</param>
        /// <param name="outProperties">The outgoing properties.</param>
        /// <param name="outStream">The output stream.</param>
        /// <remarks>
        /// The handler should not dispose the provided streams.
        /// </remarks>
        void Handle(ref string mimeType,
            Dictionary<String, String> inProperties, 
            Stream inStream, 
            Dictionary<String, String> outProperties, 
            Stream outStream);
    }
}
